﻿using B.S.BasicData.Api.Read.Application.Command.User;
using B.S.BasicData.Api.Read.DTO;
using B.S.BasicData.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.BasicData.Api.Read.Controllers
{
    /// <summary>
    /// 县级控制器
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class XianController : ControllerBase
    {
        private readonly IMediator mediator;

        public XianController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 显示县级信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<ApiResult<List<XianDTO>>> GetXian([FromQuery]GetXianCommand request)
        {
            return mediator.Send(request);
        }
    }
}
